<?php
/* This is where you would inject your sql into the database 
   but we're just going to format it and send it back
*/

/*include("config.php");
mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);


if(isset($_GET['listItem'])){
	foreach ($_GET['listItem'] as $position => $item) :
		mysql_query("UPDATE phphome_widgets SET widget_order = $position WHERE widget_id = $item");
	endforeach;
}
print_r ($sql);
 * 
 */


 include("cIncludes.php");
  session_start();
 	$kernel = new iKernel;

 
 	$db = new DB("admin_cache");
	$db->setColPrefix("admin_");
	
 if(isset($_GET['set'])){
 	
		$db->select("admin_user='".USER_ID."'");
		if($db->numRows() == "0"){
			$db->user = USER_ID;
			$db->window = $_GET['set'];
			$db->time = time();
			$db->insert();
		}else{
			$db->user = USER_ID;
			$db->window = $_GET['set'];
			$db->time = time();
			$db->update();
		}
 }

 if(isset($_GET['unset'])){
 		
		$db->delete("admin_user='".USER_ID."' and admin_window='".$_GET['unset']."'");

 }
 


 
?>